#include "key.h"
#include "reg52.h"
#include "delay.h"
unsigned char (*key_read)(void);
unsigned char key_read_hight(void){
	unsigned char i=0;
	for(i=3;i<8;i++){
		if((P0&(1<<i))==0x00){			
			DelayMs(10);
			while((P0&(1<<i))==0x00){
				
			}return i;
		}
	}
	return 0x33;
}


void key_open(int mode){
	if(mode == Hight){
		P0=0xff;
		key_read = key_read_hight;
	}
}

